﻿/*
 * The enums contained in this file are sample enums. Their purpose is to demonstrate how to attribute enums with both static and dynamic metadata such
 * that this metadata can be retreived by the various extension methods and static methods of EnumMetadata.
 * 
 * These enums are then used in the test project, EnumMetadata.Test, which shows how to consume metadata from enums that have been properly attributed.
 */
using com.ddmresources.EnumMetadata.Core.Attributes;

namespace com.ddmresources.EnumMetadata.Samples
{
    [EnumInfoSpecification(InfoModeOptions.Dynamic, typeof(EnumDynamicInfoAttribute), typeof(ClientStatusInfo))]
    public enum ClientStatus
    {       
        [EnumDynamicInfo(@"{""Id"": 10, ""Code"":""U"", ""Description"":""Unknown Status"", ""IsMapped"": false}")]
        Unknown = 0,
        [EnumDynamicInfo(@"{""Id"": 11, ""Code"":""A"", ""Description"":""Active Status"", ""IsMapped"": true}")]
        Active = 1,
        [EnumDynamicInfo(@"{""Id"": 12, ""Code"":""I"", ""Description"":""Inactive Status"", ""IsMapped"": true}")]
        Inactive = 2
    }

    [EnumInfoSpecification(InfoModeOptions.Dynamic, typeof(EnumDynamicInfoAttribute), typeof(TrafficLightColorInfo))]
    public enum TrafficLightColor
    {
        [EnumDynamicInfo(@"{""Wavelength"": 0, ""IntendedAction"":""Unknown"", ""IsColorBlind"": false, ""NTSBRegulations"":[1,2,3], ""Example"": {""Id"": 100, ""Desc"":""Description for 100""} }")]
        Unknown = 0,
        [EnumDynamicInfo(@"{""Wavelength"": 650, ""IntendedAction"":""Stop"", ""IsColorBlind"": false, ""NTSBRegulations"":[4,5,6], ""Example"": {""Id"": 101, ""Desc"":""Description for 101""} }")]
        Red = 1,
        [EnumDynamicInfo(@"{""Wavelength"": 570, ""IntendedAction"":""Slow"", ""IsColorBlind"": false, ""NTSBRegulations"":[7,8,9], ""Example"": {""Id"": 102, ""Desc"":""Description for 102""} }")]
        Yellow = 2,
        [EnumDynamicInfo(@"{""Wavelength"": 510, ""IntendedAction"":""Proceed"", ""IsColorBlind"": true, ""NTSBRegulations"":[10,11,12], ""Example"": {""Id"": 103, ""Desc"":""Description for 103""} }")]
        Green = 3
    }

    [EnumInfoSpecification(InfoModeOptions.Static, typeof(CodeTableInfoAttribute), typeof(CodeTableInfoAttribute))]
    public enum CbiType
    {
        [CodeTableInfo(MappedId = 1, MappedCode = "LO", Description = "Location")]
        LO = 1,
        [CodeTableInfo(MappedId = 2, MappedCode = "NL", Description = "Non-Location")]
        NL = 2,
        [CodeTableInfo(MappedId = 3, MappedCode = "GA", Description = "Geographic Area")]
        GA = 3,
        [CodeTableInfo(MappedId = 4, MappedCode = "MUBI", Description = "Misc. Unreported Business Interest")]
        MUBI = 4,
        [CodeTableInfo(MappedId = 5, MappedCode = "POBI", Description = "Premium Only Business Interest")]
        POBI = 5,
        [CodeTableInfo(MappedId = 6, MappedCode = "SEBI", Description = "Specific Event Business Interest")]
        SEBI = 6,
        [CodeTableInfo(MappedId = 7, MappedCode = "ETRPBI", Description = "Exported Tariff Return Premium Business Interest")]
        ETRPBI = 7,
        [CodeTableInfo(MappedId = 8, MappedCode = "UBI", Description = "Unreported Business Interest")]
        UBI = 8

    }

    [EnumInfoSpecification(InfoModeOptions.Static, typeof(HelpTopicInfoAttribute), typeof(HelpTopicInfoAttribute))]
    public enum HelpTopic
    {
        [HelpTopicInfo("000", true, "Threepane")]
        Overview = 1,
        [HelpTopicInfo("001", true, "")]
        AccountView = 2,
        [HelpTopicInfo("002", true, "")]
        LocationsView = 3,
        [HelpTopicInfo("101", false, "Threepane")]
        EngineeringView = 4,
        [HelpTopicInfo("102", false, "")]
        ConstructionView = 5
    }

    public enum MissingEnumInfoSpecification
    {
        [EnumDynamicInfo(@"{""Id"": 1, ""Code"":""One"", ""Description"":""One Description""}")]
        Value1 = 1,
        [EnumDynamicInfo(@"{""Id"": 2, ""Code"":""Two"", ""Description"":""Two Description""}")]
        Value2 = 2
    }

    [EnumInfoSpecification(InfoModeOptions.Dynamic, null, typeof(ClientStatusInfo))]
    public enum MissingMetadatAttributeTypeProperty
    {
        [EnumDynamicInfo(@"{""Id"": 1, ""Code"":""One"", ""Description"":""One Description""}")]
        Value1 = 1,
        [EnumDynamicInfo(@"{""Id"": 2, ""Code"":""Two"", ""Description"":""Two Description""}")]
        Value2 = 2
    }

    [EnumInfoSpecification(InfoModeOptions.Dynamic, typeof(EnumDynamicInfoAttribute), null)]
    public enum MissingOutputTypeProperty
    {
        [EnumDynamicInfo(@"{""Id"": 1, ""Code"":""One"", ""Description"":""One Description""}")]
        Value1 = 1,
        [EnumDynamicInfo(@"{""Id"": 2, ""Code"":""Two"", ""Description"":""Two Description""}")]
        Value2 = 2
    }

    [EnumInfoSpecification(0, typeof(EnumDynamicInfoAttribute), typeof(ClientStatusInfo))]
    public enum InvalidInfoMode
    {
        [EnumDynamicInfo(@"{""Id"": 1, ""Code"":""One"", ""Description"":""One Description""}")]
        Value1 = 1,
        [EnumDynamicInfo(@"{""Id"": 2, ""Code"":""Two"", ""Description"":""Two Description""}")]
        Value2 = 2
    }

    [EnumInfoSpecification(InfoModeOptions.Dynamic, typeof(EnumDynamicInfoAttribute), typeof(ClientStatusInfo))]
    public enum MissingDynamicInfo
    {        
        Value1 = 1,
        [EnumDynamicInfo(@"{""Id"": 2, ""Code"":""Two"", ""Description"":""Two Description""}")]
        Value2 = 2
    }
}
